//
//  UIViewController+navigation.m
//  SecondPackage
//
//  Created by 韩艳锋 on 2019/7/2.
//  Copyright © 2019 韩艳锋. All rights reserved.
//

#import "UIViewController+navigation.h"
#import <objc/runtime.h>
@implementation UIViewController (navigation)

-(void)navigationConceal{
    
}
-(void)navigationShow{
    
}

-(void)navigationConcealBack{
    [self setNavigationBackImage:[self.navigationController.navigationBar backgroundImageForBarMetrics:UIBarMetricsDefault]];
    [self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc]init] forBarMetrics:UIBarMetricsDefault];
    [self.navigationController.navigationBar setShadowImage:[[UIImage alloc] init]];
}

-(void)navigationShowBack{
    [self.navigationController.navigationBar setBackgroundImage:[self navigationBackImage] forBarMetrics:UIBarMetricsDefault];
    [self.navigationController.navigationBar setShadowImage:nil];
}

-(void)navigationConcealItem{
    
}
-(void)navigationShowItem{
    
}

static NSString *conNavigationBackImage = @"";
-(UIImage*)navigationBackImage {
    return objc_getAssociatedObject(self, &conNavigationBackImage);
}
-(void)setNavigationBackImage:(UIImage*)image{
    objc_setAssociatedObject(self, &conNavigationBackImage, image, OBJC_ASSOCIATION_COPY);
}
@end
